package wli.java.file.util;

import static org.junit.Assert.*;

import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;

import org.junit.Test;

public class DirectoryUtilTest {

	@Test
	public void testShowFiles() {
		File f = new File("C:\\Apache\\htdocs\\DailyLogs");
		DirectoryUtil du = new DirectoryUtil(f.getPath());		
		du.showFiles(f.listFiles());
	
		ArrayList<FileStructure> list = (ArrayList<FileStructure>) du.getFileStructureList();
		Collections.sort(list);
		Iterator<FileStructure> it = list.iterator();
		FileStructure fstu;
		
		while (it.hasNext()) {
			fstu = it.next();
			System.out.println("UFID=" + fstu.getUfid()+"PID=" + fstu.getPid()+"  Name="+fstu.getName()+"  PATH="+fstu.getPath()+"  URI="+fstu.getUrl());
		}
	}
}
